package com.red.star.wechat.data.entity;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @author nofish.yan@gmail.com
 * @date 2018/1/30.
 * 聊天消息实体
 */
@Data
@Document(collection = "chat_log")
public class ChatMessage {

    @Id
    private String id;

    /**
     * 粉丝ID
     **/
    @Field(value = "c_fans_id")
    private Integer cFansId;

    /**
     * 导购员ID
     **/
    @Field(value = "b_fans_id")
    private Integer bFansId;

    /**
     * B端商场管理员ID
     */
    @Field(value = "admin_fans_id")
    private Integer adminFansId;

    /**
     * E端管理员ID
     */
    @Field(value = "admin_id")
    private Integer adminId;

    /**
     * 商场code
     */
    @Field(value = "mall_code")
    private String mallCode;

    /**
     * 消息流向
     **/
    private Integer direction;

    /**
     * 消息类型
     * 0:文本  启用中
     * 1:图片  启用中
     * 2:海报
     * 3:爆款
     * 4:券
     * 5:接待组 启用中
     * 6:联盟组 启用中
     * 7:意向卡
     * 8:需求卡
     **/
    private Integer type;

    /**
     * 文本消息内容
     **/
    private String content;

    /**
     * 图片消息
     **/
    private String img;

    /**
     * 电子海报ID
     **/
    @Field(value = "poster_id")
    private String posterId;

    /**
     * 爆款ID
     **/
    @Field(value = "hot_id")
    private String hotId;

    /**
     * 优惠券ID
     **/
    @Field(value = "coupon_id")
    private String couponId;

    /**
     * 消息时间
     **/
    @Field(value = "create_time")
    private Date createTime;

    /**
     * 附加信息
     */
    private String data;

    /**
     * 聊天会话ID
     */
    @Field(value = "chat_session_id")
    private String chatSessionId;

    @Transient
    private Integer groupId;
    @Transient
    private String nickname;
    @Transient
    private String avatarUrl;
    @Transient
    private String senderType;

    private Integer expectId;

    private Integer requireId;

    private Integer productId;
}
